package com.centaline.androidsalesblog.api.sale;

import com.android.volley.DefaultRetryPolicy;
import com.android.volley.RetryPolicy;
import com.baidu.mapapi.model.LatLng;
import com.centaline.androidsalesblog.api.SaleApi;
import com.centaline.androidsalesblog.model.responseobject.StoreListRo;
import com.centanet.framework.interfaces.IResponseListener;

/**
 * 门店列表—地图使用
 * Created by Lihq on 16/5/13.
 */
public class StoreMapApi extends SaleApi<StoreListRo> {

    private LatLng northeast, southwest;

    public StoreMapApi(Class<?> tag, Class<StoreListRo> aClass, IResponseListener<StoreListRo> iResponseListener) {
        super(tag, aClass, iResponseListener);
    }

    public void setNortheast(LatLng northeast) {
        this.northeast = northeast;
    }

    public void setSouthwest(LatLng southwest) {
        this.southwest = southwest;
    }

    @Override
    protected void setParams() {
        putParams("lngMin", southwest.longitude);
        putParams("lngMax", northeast.longitude);
        putParams("latMin", southwest.latitude);
        putParams("latMax", northeast.latitude);
    }

    @Override
    protected String getPath() {
        return "Store";
    }

    @Override
    protected RetryPolicy getRetryPolicy() {
        return new DefaultRetryPolicy(2500, 3, 1.0F);
    }

}
